<template>
	<view :class="['card', isBlue ? 'blue-bg' : 'black-bg']" @click="clickCard">
		<text>{{ title }}</text>
		<slot>
			<text>{{ num }}</text>
		</slot>
	</view>
</template>

<script>
	export default {
		name: "XbdCard",
		props: {
			title: String,
			num: Number,
			isBlue: Boolean
		},
		methods: {
			clickCard() {
				this.$emit('clickCard')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.card {
		display: flex;
		align-items: center;
		justify-content: space-between;
		
		width: 310rpx;
		height: 60px;
		padding: 0 30rpx;
		border-radius: 12rpx;
		margin-top: 10px;
		
		font-size: 32rpx;
		color: #FFFFFF;
		
		box-sizing: border-box;
		&:nth-child(1), &:nth-child(2) {
			margin-top: 0;
		}
	}
	.blue-bg {
		background: url(../../static/images/common/bluebg.png) no-repeat;
		background-size: 100% 100%;
	}
	.black-bg {
		background: url(../../static/images/common/blackbg.png) no-repeat;
		background-size: 100% 100%;
	}
</style>
